<template>
  <router-view v-slot="{ Component }">
    <KeepAlive :include="['drugStore']">
      <component :is="Component" />
    </KeepAlive>
  </router-view>
</template>

<script>
(function () {
  if (
    typeof WeixinJSBridge == "object" &&
    typeof WeixinJSBridge.invoke == "function"
  ) {
    handleFontSize()
  } else {
    document.addEventListener("WeixinJSBridgeReady", handleFontSize, false)
  }
  function handleFontSize () {
    // 设置网页字体为默认大小
    WeixinJSBridge.invoke("setFontSizeCallback", { fontSize: 0 })
    // 重写设置网页字体大小的事件
    WeixinJSBridge.on("menu:setfont", function () {
      WeixinJSBridge.invoke("setFontSizeCallback", { fontSize: 0 })
    })
  }
})()
</script>
<style lang="scss">
* {
  box-sizing: border-box;
}
#app {
  min-height: 100vh;
  width: 100vw;
}
.page {
  min-width: 100vw;
  min-height: 100vh;
  background: #f1f2f7;
}
</style>
